﻿/********************************************
 * 
 *      正则表达式参考文件
 * 
 *      creat by ternence
 *      
 *      2016-03-17
 * 
 * ******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NF_Base
{
    public class RegexExpConfig
    {
        /// <summary>
        /// 验证价格正则表达式
        /// </summary>
        public const string CheckPrice = @"^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|^\d+$";

        /// <summary>
        /// 验证邮箱
        /// </summary>
        public const string CheckEmail = @"[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?";

        /// <summary>
        /// 验证为正整数
        /// </summary>
        public const string CheckPositiveInteger = @"^[0-9]\d*$";

        /// <summary>
        /// 验证只能是数字
        /// </summary>
        public const string CheckNumber = "^[0-9]*$";

        /// <summary>
        /// 只能输入汉字
        /// </summary>
        public const string CheckChina = "^[u4e00-u9fa5],{0,}$";  

        /// <summary>
        /// 手机号验证
        /// </summary>
        public const string CheckPhone = @"^[1]+[3,4,5,7,8]+\d{9}";

        /// <summary>
        /// 验证座机
        /// 匹配3位或4位区号的电话号码，其中区号可以用小括号括起来，
        /// 也可以不用，区号与本地号间可以用连字号或空格间隔，
        /// 也可以没有间隔
        /// </summary>
        public const string CheckLandlinePhone = @"^\\(0\\d{2}\\)[- ]?\\d{8}$|^0\\d{2}[- ]?\\d{8}$|^\\(0\\d{3}\\)[- ]?\\d{7}$|^0\\d{3}[- ]?\\d{7}$";

        /// <summary>
        /// 身份证验证
        /// </summary>
        public const string CheckCardId = @"^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$";
    }
}
